package ch.netcetera.planningpoker.client;

import ch.netcetera.planningpoker.client.ui.admin.create.CreateGamePresenter;
import ch.netcetera.planningpoker.client.ui.admin.create.CreateGameView;
import ch.netcetera.planningpoker.client.ui.admin.moderate.ModerationPresenter;
import ch.netcetera.planningpoker.client.ui.admin.moderate.ModerationView;
import ch.netcetera.planningpoker.client.ui.admin.round.ModeratorRoundPresenter;
import ch.netcetera.planningpoker.client.ui.admin.round.ModeratorRoundView;
import ch.netcetera.planningpoker.client.ui.main.MainPagePresenter;
import ch.netcetera.planningpoker.client.ui.main.MainPageView;
import ch.netcetera.planningpoker.client.ui.participant.create.CreateParticipantPresenter;
import ch.netcetera.planningpoker.client.ui.participant.create.CreateParticipantView;
import ch.netcetera.planningpoker.client.ui.participant.play.PlayPresenter;
import ch.netcetera.planningpoker.client.ui.participant.play.PlayView;
import ch.netcetera.planningpoker.client.ui.round.RoundPresenter;
import ch.netcetera.planningpoker.client.ui.round.RoundView;
import ch.netcetera.planningpoker.client.ui.widget.userlist.UserListPresenter;
import ch.netcetera.planningpoker.client.ui.widget.userlist.UserListView;
import ch.netcetera.planningpoker.shared.GameRequestFactory;

import com.google.inject.Singleton;
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
import com.gwtplatform.mvp.client.gin.DefaultModule;

public class PokerModule extends AbstractPresenterModule {

    @Override
    protected void configure() {
        install(new DefaultModule(PokerPlaceManager.class));

        // Presenters
        bindPresenter(MainPagePresenter.class,
                MainPagePresenter.IView.class, MainPageView.class,
                MainPagePresenter.IProxy.class);
        bindPresenter(CreateGamePresenter.class,
                CreateGamePresenter.IView.class, CreateGameView.class,
                CreateGamePresenter.IProxy.class);
        bindPresenter(ModerationPresenter.class,
                ModerationPresenter.IView.class, ModerationView.class,
                ModerationPresenter.IProxy.class);
        bindPresenter(CreateParticipantPresenter.class, 
                CreateParticipantPresenter.IView.class, CreateParticipantView.class, 
                CreateParticipantPresenter.IProxy.class);
        bindPresenter(PlayPresenter.class, 
                PlayPresenter.IView.class, PlayView.class, 
                PlayPresenter.IProxy.class);        
        bindPresenter(UserListPresenter.class, 
                UserListPresenter.IView.class, UserListView.class, 
                UserListPresenter.IProxy.class);        
        bindPresenter(ModeratorRoundPresenter.class, 
                ModeratorRoundPresenter.IView.class, ModeratorRoundView.class, 
                ModeratorRoundPresenter.IProxy.class);         
        bindPresenter(RoundPresenter.class, 
                RoundPresenter.IView.class, RoundView.class, 
                RoundPresenter.IProxy.class);         
        
        // Other classes
        bind(GameRequestFactory.class).in(Singleton.class);

    }
}
